import { ApiCall } from "tsrpc";
import { ReqLook, ResLook } from "../../../shared/master/strengthen/PtlLook";
import { player } from "../../../model/fight/body/player";
import manage_EquipStrengthen from "../../model/manage/manage_EquipStrengthen";
import { template } from "../../../shared/master/MsgAction";
import app from "../../../app";
let need_strengthen = app.getCfgData('prop-20')
let need_resting = app.getCfgData('prop-14')
export default async function (call: ApiCall<ReqLook, ResLook>) {
    let user = call.req._player as player;
    let e = manage_EquipStrengthen.get(user.uuid);
    if (!e) {
        user.sendMsg(template.default, '铁匠铺内还没有放入装备哦~\n💡铁匠铺中的装备为您最后一次在装备栏/背包查看的装备')
        call.error('')
        return;
    }
    call.succ({
        equip: {
            name: e.name, from: e.from, score: e.getScore(), leve: e.leve.num
        },
        succ: e.strengthen_get(),
        down: e.strengthen_down(),
        need_strengthen: `${need_strengthen.icon}${need_strengthen.name}x${e.strengthen_need()}`,
        need_resting: `${need_resting.icon}${need_resting.name}`
    })
}